<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
<meta charset="UTF-8">
<title>我的招聘主页</title>
<script type="text/javascript" src="../jquery/jquery-3.5.1.js"></script>
<link href="../bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" type="text/css"> 
<script src="../bootstrap-3.3.7-dist/js/bootstrap.js"></script>
</head>
<body >
<nav class="navbar navbar-default">
<div class="row">
  <div class="col-xs-12 col-md-8 col-md-offset-1">
  <div class="col-md-1">
  </div>
   <h1 >我的招聘页</h1>
   </div>
    
  <div class="col-xs-6 col-md-4"> 

  </div>
</div>
</nav>
<div class="row">
  <div class="col-md-2">
   <div style="display:none">
    <h5 sec:authentication="principal.uid" id="id" name="id"></h5>
   </div>
   
   <button id="MyRecruitmentBtn" class="btn btn-primary btn-lg btn-block">发布招聘</button>
   <button id="HistoryRecruitmentBtn" class="btn btn-primary btn-lg btn-block">历史招聘</button>
   <button id="MyComanyBtn" class="btn btn-primary btn-lg btn-block">公司信息</button>
   <button id="ReceiveResumeBtn" class="btn btn-primary btn-lg btn-block">我收到的简历</button>
  </div>
  <div class="col-md-8" >
  <!-- 粘贴招聘信息 -->
  <table  class="table table-hover">
  <tbody id="recruitment_tbody">
  <!-- 粘贴分页信息 -->
  </tbody>
</table>
 <div class="col-md-4 col-md-offset-4" id="recruitment_info">
 <!-- 粘贴分页标签向导 -->
</div>
  </div>
</div>
<div class="col-md-2"></div>
<!-- 填写招聘信息模态框 -->
<div class="modal fade" id="myModalForResruitment" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">招聘信息</h4>
      </div>
      <div class="modal-body">
      <div class="row">
  <div class="col-md-6 col-md-offset-3 ">
  <!-- form表单 -->
<form id="RecruitmentInfo" class="form-horizontal">
 <div class="form-group " style="display:none">
    <input  type="text" class="form-control" id="uid" name="uid">
  </div>
  <div class="form-group ">
    <label >标题</label>
    <input type="text" class="form-control " id="zpname" name="zpname" placeholder="招聘标题">
  </div>
  <div class="form-group ">
    <label >经验</label>
    <input type="text" class="form-control " id="jinyang" name="jinyang" placeholder="经验">
  </div >
  <!--  -->
  <div class="form-group " style="display:none">
    <label >工作性质</label>
    <input type="text" class="form-control " id="zwid" name="zwid">
  </div >
   <div class="form-group ">
    <label >工作性质</label>
    <select id="zwids" class="form-control">
     <option value="1">全职</option>
     <option value="2">兼职</option>
     <option value="3">实习生</option>
     <option value="4">小时工</option>
     </select>
  </div>
   <!--  -->
  <div class="form-group " style="display:none">
    <label >工作性质</label>
    <input type="text" class="form-control " id="xueli" name="xueli">
  </div >
  <div class="form-group ">
    <label >学历要求</label>
    <select id="xuelis" class="form-control">
     <option value="本科及以上">本科及以上</option>
     <option value="大专及以上">大专及以上</option>
     <option value="硕士研究生">硕士研究生</option>
     <option value="博士">博士</option>
   </select>
  </div>
   
  <div class="form-group ">
    <label >薪资</label>
    <input type="text" class="form-control " id="salary" name="salary" placeholder="薪资">
  </div >
  <div class="form-group ">
    <label >岗位要求</label>
    <input type="text" class="form-control " id="gongzuozhize" name="gongzuozhize" placeholder="岗位要求">
  </div >
  <div class="form-group ">
    <label >岗位职责</label>
    <input type="text" class="form-control " id="gongzuoyaoqiu" name="gongzuoyaoqiu" placeholder="岗位职责">
  </div >
  <div class="form-group " style="display:none">
  <label >被举报次数</label>
    <input type="text" class="form-control " value="0" id="fzcount" name="fzcount" >
  </div >
</form>

</div>
</div>
      </div>
      <div class="modal-footer">
        <button  id="CloseRecruitment"type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" id ="SaveRecruitment">发布</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 填写公司信息的模态框 -->
<div class="modal fade" id="myModalForCompany" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">您的公司信息</h4>
      </div>
      <div class="modal-body">
      <div class="row">
  <div class="col-md-6 col-md-offset-3 ">
  <!-- form表单 -->
<form id="CompanyInfo" class="form-horizontal">
 <div class="form-group " style="display:none">
    <input  type="text" class="form-control" id="ucid" name="ucid">
  </div>
  <div class="form-group ">
    <label >您在公司的职位</label>
    <input type="text" class="form-control " id="identity" name="identity" >
  </div>
  <div class="form-group ">
    <label >您所在的公司名称</label>
    <input type="text" class="form-control " id="company" name="company" >
  </div >
  <!--  -->
  <div class="form-group " >
    <label >公司地址</label>
    <input type="text" class="form-control " id="address" name="address">
  </div >
   <!--  -->
  <div class="form-group " >
    <label >公司电话</label>
    <input type="text" class="form-control " id="telephone" name="telephone">
  </div >
  <div class="form-group ">
    <label >公司官网</label>
    <input type="text" class="form-control " id="web" name="web" >
  </div >
</form>

</div>
</div>
      </div>
      <div class="modal-footer">
        <button  id="SloseCompany"type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" id ="SaveCompany">保存</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- 查看招聘信息的模态框 -->
<div id="myRecruitmentModal" class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4  id="tdzt"class="modal-title"></h4>
      </div>
      <div id="onerecruitment" class="modal-body">
        <!-- <p>One fine body&hellip;</p> -->
        <!-- 此处放消息体 -->
      </div>
      <div class="modal-footer">
       
        <button id="closeOneRecruitmentbtn" type="button" class="btn btn-primary">关闭</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- 查看投递者简历详细信息模态框 -->
<div id="sweekerResumeModal" class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4  id="applytitle"class="modal-title"></h4>
      </div>
      <div id="sweekerresume" class="modal-body">
        <!-- <p>One fine body&hellip;</p> -->
        <!-- 此处放消息体 -->
      </div>
      <div class="modal-footer">
       
        <button id="sweekerBtn" type="button" class="btn btn-primary">关闭</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/javascript">
//全局变量，用户id
var uid;
$(function(){
	 uid=$("#id").text();
	$("#uid").attr("value",uid);
	//查看是否已经注册过
	
}); 
//招聘信息模态框显示
$("#MyRecruitmentBtn").click(function(){

	$("#myModalForResruitment").modal({
		backdrop:"static"
	});
	})
//关闭历史招聘信息模态框	
$("#closeOneRecruitmentbtn").click(function(){
	$("#myRecruitmentModal").modal('hide');
	})
	
//关闭求职者投递信息模态框	
$("#sweekerBtn").click(function(){
	$("#sweekerResumeModal").modal('hide');
	})
	
//查看公司信息
$("#MyComanyBtn").click(function(){
	//先查询检查是否已经注册过
	$.ajax({
		url:"/user/selectCompanyByUid",
		type:"POST",
		data:{ucid:uid},
		ansyc:false,
		success:function(result){
			//招聘者已经填注册过公司，则将公司信息粘贴
			if(result.code==100){
				pastecompanyinfo(result);
			}else if(result.code==200){  
				//用户不存在才可以插入
				//如果检查未注册过,显示模态框才能注册公司
			alert("您还未注册");
				$("#myModalForCompany").modal({
		           backdrop:"static"
	               });
			}
		}
		
	});
})
	//注册公司信息
 $("#SaveCompany").click(function(){
	 $.ajax({
			url:"/user/insertUserCompany",
			type:"POST",
			data:$("#CompanyInfo").serialize(),
			success:function(result) {
				alert(result.msg);
				
			}
		});
 })
 
	
	
//关闭公司信息模态框	
$("#SloseCompany").click(function(){
	$("#myModalForResruitment").modal('hide');
	})	
	
//发布招聘信息	
$("#SaveRecruitment").click(function () {
	
	//从多选框中粘贴信息到对应的input中，方便封装
	if($("#zwids").val()!=""||$("#zwids").val()!=null){
		$("#zwid").attr("value",$("#zwids").val());
	}
	if($("#xuelis").val()!=""||$("#xuelis").val()!=null){
		$("#xueli").attr("value",$("#xuelis").val());
	}
	//先检查是否注册过公司
	$.ajax({
		url:"/user/selectCompanyByUid",
		type:"POST",
		data:{ucid:uid},
		ansyc:false,
		success:function(result){
			//如果注册了公司则可以进行招聘信息发布
			if(result.code==100){
				//发布招聘信息
				$.ajax({
					url:"/user/insertRecruitmentInfo",
					type:"POST",
					data:$("#RecruitmentInfo").serialize(),
					success:function(result) {
						alert(result.msg);	
				 	                          }
				       });
			}else if(result.code==200){  //未注册公司信息，用户则不可以发布招聘信息
			alert("请先填写您的公司信息");
			}
		}
		
	});
		
})
//粘贴公司信息
function pastecompanyinfo(result){
	var companyinfo=result.extend.selectCompanyByUid;
	
	$("#recruitment_tbody").empty();
	$("#recruitment_info").empty();
	//公司
 	var com=$("<dt></dt>").append("我的公司： ");
 	var comname=$("<dt></dt>").append(companyinfo.company);
 	var comdl=$("<dl></dl>").append(com).append(comname);
 	var td1=$("<td></td>").append(comdl);
 	//我的职位
 	
 	var job=$("<dt></dt>").append("我的职位： ");
 	var jobname=$("<dt></dt>").append(companyinfo.identity);
 	var jobdl=$("<dl></dl>").append(job).append(jobname);
 	var td2=$("<td></td>").append(jobdl);
 	//公司地址
 	var addr=$("<dt></dt>").append("公司地址： ");
 	var addrname=$("<dt></dt>").append(companyinfo.address);
 	var addrdl=$("<dl></dl>").append(addr).append(addrname);
 	var td3=$("<td></td>").append(addrdl);
 	//公司电话
 	var pho=$("<dt></dt>").append("公司电话： ");
 	var phoname=$("<dt></dt>").append(companyinfo.telephone);
 	var phodl=$("<dl></dl>").append(pho).append(phoname);
 	var td4=$("<td></td>").append(phodl);
 	//公司官网
 	var web=$("<dt></dt>").append("公司官网： ");
 	var wenname=$("<dt></dt>").append(companyinfo.web);
 	var webdl=$("<dl></dl>").append(web).append(wenname);
 	var td5=$("<td></td>").append(webdl);
 	
 	
 	$("<tr><tr>")
 	.append(td1)
 	.append(td2)
 	.append(td3)
 	.append(td4)
 	.append(td5)
 	.appendTo("#recruitment_tbody");
}
//招聘者查看自己的历史招聘信息
$("#HistoryRecruitmentBtn").click(function(){
	$("#PasteInfo").empty();
	$.ajax({
		url:"/user/selectRecruitmentInfoByUid",
		type:"POST",
		data:{uid:uid,pages:1},
		ansyc:false,
		success:function(result){
			if(result.code==100){
				PasteHistoryRecruitment(result);
				PasteHistoryRecruitmentNavigatepageNums(result);
			}else if(result.code==200){
				alert("您还未发布过招聘");
			}
			
		}
		
	});
	
})


//分页粘贴投递信息
function PasteHistoryRecruitment(result){
	var ResumeInfos=result.extend.RecruitmentPageInfo.list;
	
	$("#recruitment_tbody").empty();
	$.each(ResumeInfos,function(index,items){
		
 		////列表第一列
		var zpn=$("<span></span>").append(items.zpname).addClass("label label-info");
		var zapname=$("<dt></dt>").append(zpn);
		var company=$("<dt></dt>").append(items.companyInfo.company);
		var dl1=$("<dl></dl>").append(zapname);
		var td1=$("<td></td>").append(dl1);
		
		var salary=$("<span></span>").append(items.salary).addClass("label label-info");
 		var xueli=$("<span></span>").append(items.xueli);
	    var jinyang=$("<span></span>").append(items.jinyang);
	    var salarydt=$("<dt></dt>").append(salary);
	    var xuelijinyangdt=$("<dt></dt>").append(xueli).append(" ").append(salarydt);
	    var dl2=$("<dl></dl>").append(salarydt).append(xuelijinyangdt);
		var td2=$("<td></td>").append(dl2);
		
	    
	    var addressspan=$("<span></span>").addClass("glyphicon glyphicon-map-marker");
		var address=$("<span></span>").append(items.companyInfo.address);
		var addressdt=$("<dt></dt>").append(addressspan).append(address);
		var hr=$("<dt></dt>").append(items.companyInfo.identity);
		var dl3=$("<dl></dl>").append(addressdt).append(hr);
		var td3=$("<td></td>").append(dl3);
		
		//查看详细招聘信息
		var detialbtn=$("<button></button>").append("详情").addClass("btn btn-primary");
		detialbtn.click(function(){
			$("#onerecruitment").empty();
		 	$("#myRecruitmentModal").modal({
		 		backdrop:"static"
		 	});
		 	//模态框标题
		 	$("#zpzt").append(items.zpname);
		 	
			var zwxz=$("<span></span>").append(items.jobxingzhi.zhiweiname).addClass("label label-info");
		 	var zw=$("<dt></dt>").append(zwxz);
		 	//招聘者
		 	var com=$("<span></span>").append(items.companyInfo.company);
		 	var index=$("<span></span>").append(".");
		 	var identity=$("<span></span>").append(items.companyInfo.identity);
		 	var zhaoinzhe=$("<dt></dt>").append(com).append(index).append(identity);
		 	//薪资
		 	var salary=$("<span></span>").append("薪资:  ");
		 	var sal=$("<dt></dt>").append(salary).append(items.salary);
		 	//学历
		 	var xueli=$("<span></span>").append("学历:  ");
		 	var xul=$("<dt></dt>").append(xueli).append(items.xueli);
		 	//经验
		 	var jinyang=$("<span></span>").append("经验:  ");
		 	var jyg=$("<dt></dt>").append(jinyang).append(items.jinyang);
		 	//职位详情
		 	var zwxq=$("<span></span>").append("职位详情").addClass("label label-info");
		 	var zwx=$("<dt></dt>").append(zwxq);
		 	//岗位职责
		 	var gwzz=$("<span></span>").append("岗位职责");
		 	var gwy=$("<dt></dt>").append(gwzz);
		 	var gongzuozhize=$("<dt></dt>").append(items.gongzuozhize);
		 	//岗位要求
		 	var gwyq=$("<span></span>").append("岗位要求");
		 	var gzyq=$("<dt></dt>").append(gwyq);
		 	var gongzuoyaoqiu=$("<dt></dt>").append(items.gongzuoyaoqiu);
		 	
		 	//公司信息
		 	var gsxx=$("<span></span>").append("公司信息").addClass("label label-info");
		 	var gsxx1=$("<dt></dt>").append(gsxx);
		 	//名称
		 	var companyname=$("<span></span>").append("名称:  ");
		 	var company=$("<dt></dt>").append(companyname).append(items.companyInfo.company);
		 	//地址
		 	var addr=$("<span></span>").append("地址：  ");
		 	var address=$("<dt></dt>").append(addr).append(items.companyInfo.address);
		 	//电话
		 	var tele=$("<span></span>").append("电话：  ");
		 	var telephone=$("<dt></dt>").append(tele).append(items.companyInfo.telephone);
		 	//官网
		 	var web=$("<span></span>").append("官网：  ");
		 	var website=$("<dt></dt>").append(web).append(items.companyInfo.web);
		 	var dl=$("<dl></dl>")
		 	.append(zhaoinzhe)
		 	.append(zw)
		 	.append(sal)
		 	.append(xul)
		 	.append(jyg)
		 	.append(zwx)
		 	.append(gwy)
		 	.append(gongzuozhize)
		 	.append(gzyq)
		 	.append(gongzuoyaoqiu)
		 	.append(gsxx1)
		 	.append(company)
		 	.append(address)
		 	.append(telephone)
		 	.append(website)
		 	.appendTo("#onerecruitment");
		 	
		 	
		 	
			
		});
		var time=$("<span></span>").append(items.time);
		var timemodel=$("<span></span>").addClass("glyphicon glyphicon-time");
		var timedt=$("<dt></dt>").append(timemodel).append(" ").append(time);
		var detialdt=$("<dt></dt>").append(detialbtn);
		var dl4=$("<dl></dl>").append(detialdt).append(timedt);
		var td4=$("<td></td>").append(dl4);
		 $("<tr></tr>")
	        .append(td1)
	        .append(td2)
	        .append(td3)
	        .append(td4)
	        .appendTo("#recruitment_tbody");
			
	});
}
//粘贴分页导航跳转
function HistoryRecruitmentTopage(page){
	
	$.ajax({
		url:"/user/selectRecruitmentInfoByUid",
		type:"POST",
		data:{uid:uid,pages:page},
		ansyc:false,
		success:function(result){
			if(result.code==100){
				PasteHistoryRecruitment(result);
				PasteHistoryRecruitmentNavigatepageNums(result);
			}else if(result.code==200){
				alert("您还未发布过招聘");
			}
			
		}
		
	});
}

//粘贴分页导航跳转
function PasteHistoryRecruitmentNavigatepageNums(result){
	//插入前先清空
	$("#recruitment_info").empty();
	var navigatepages=result.extend.RecruitmentPageInfo.navigatepageNums;
	//当前页
	var pageNum=result.extend.RecruitmentPageInfo.pageNum;
	
	
	var firstPage=$("<li></li>").append($("<a></a>").append("首页"));
	
	firstPage.click(function () {
		HistoryRecruitmentTopage(1);
	});
	var perviousPage=$("<li></li>").append($("<a></a>").append("&laquo;"));
	
	perviousPage.click(function() {
			if(result.extend.RecruitmentPageInfo.hasPreviousPage==true){
			
				HistoryRecruitmentTopage(result.extend.RecruitmentPageInfo.prePage);
			}
		});
		
	var nextPage=$("<li></li>").append($("<a></a>").append("&raquo;"));
	
	nextPage.click(function() {
	if(result.extend.RecruitmentPageInfo.hasNextPage==true)
	{
		
		HistoryRecruitmentTopage(result.extend.RecruitmentPageInfo.nextPage);
	}
	});
	var lastPage=$("<li></li>").append($("<a></a>").append("末页"));
	
	lastPage.click(function () {
		HistoryRecruitmentTopage(result.extend.RecruitmentPageInfo.pages);
	});
	
	var ul=$("<ul></ul>").addClass("pagination");
	var nav=$("<nav></nav>");
	//判断是否有前一页
	if(result.extend.RecruitmentPageInfo.hasPreviousPage==false)
		{
		firstPage.addClass("disabled");
		perviousPage.addClass("disabled ");
		}
	ul.append(firstPage).append(perviousPage);
	//遍历插入并添加点击事件
	$.each(navigatepages,function(index,items){
		var numli= $("<li></li>").append($("<a></a>").append(items));
		if(pageNum==items){
		
			numli.addClass("active");
		}
		numli.click(function() {
			HistoryRecruitmentTopage(items);
		});
		ul.append(numli);
		});
	
	//判断是否有后一页
	if(result.extend.RecruitmentPageInfo.hasNextPage==false)
	{
	nextPage.addClass("disabled");
	lastPage.addClass("disabled");
	}
	ul.append(nextPage).append(lastPage);
	nav.append(ul).appendTo("#recruitment_info");
	
}
//查询收到的简历
$("#ReceiveResumeBtn").click(function(){
	
	$.ajax({
		url:"/user/selectResumeWithRecruitmentByZUid",
		type:"POST",
		data:{uid:uid,pages:1},
		ansyc:false,
		success:function(result){
			if(result.code==200){
				alert("您暂时未收到投递信息");
			}else{
				PasteResumeInfoWtihRecruitment(result);
				PasteHistoryReceviedResumeNavigatepageNums(result);
			}
		}
	});
})

//粘贴收到的简历投递信息
function PasteResumeInfoWtihRecruitment(result){
	var ResumeInfos=result.extend.selectResumeWithRecruitmentByZUid.list;
	
	$("#recruitment_tbody").empty();
	$.each(ResumeInfos,function(index,items){
		//求职者投递的单个简历的详细信息
		var sweekerresume=items;
 		////列表第一列,投递人
		
		var tdname=$("<dt></dt>").append(items.name);
		
		var dl1=$("<dl></dl>").append(tdname);
		var td1=$("<td></td>").append(dl1);
		
		//第二列 投递人学校
	    var college=$("<dt></dt>").append(items.college);
	    var dl2=$("<dl></dl>").append(college);
		var td2=$("<td></td>").append(dl2);
		
		//第三列 投递岗位
	    var job=$("<dt></dt>").append(items.recruitmentInfo.zpname);
	    var dl3=$("<dl></dl>").append(job);
		var td3=$("<td></td>").append(dl3);
		
		//判断简历是否已经被招聘者查看,方便求职者知晓
		var ifChecked=items.jltdInfo.checked;
		var tid=items.jltdInfo.tid;
		
		//第四列,简历详情+投递时间
	    var detialbtn=$("<button></button>").append("详情").addClass("btn btn-primary");
	    detialbtn.click(function(){
	    	//判断是否已经阅读过
	    	if(ifChecked==false){
	    		checkedTrue(tid);
	    	}	
	    	//显示详细信息
	    	SweekerResumeDetialInfo(sweekerresume);
	    	
	    });
	    var date=$("<span></span>").append(items.jltdInfo.time);
		var datemodel=$("<span></span>").addClass("glyphicon glyphicon-time");
		var btndt=$("<dt></dt>").append(detialbtn);
		var datadt=$("<dt></dt>").append(datemodel).append(date);
		var dl4=$("<dl></dl>").append(btndt).append(datadt);
		var td4=$("<td></td>").append(dl4);
		
		 $("<tr></tr>")
	        .append(td1)
	        .append(td2)
	        .append(td3)
	        .append(td4)
	        .appendTo("#recruitment_tbody");
			
	});
}
//设置简历信息已阅读
function checkedTrue(tid){
	$.ajax({
		url:"/user/updateJltdIfCheckedByPrimaryKey",
		type:"POST",
		data:{tid:tid},
		ansyc:false,
		success:function(result){
			alert("您是个好老板，每份简历都用心查看");
		}
		
	});
}
//显示单个简历详细信息
function SweekerResumeDetialInfo(sweekerresume){
	$("#sweekerresume").empty();
	$("#applytitle").empty();
	$("#sweekerResumeModal").modal({
		backdrop:"static"
	});
	$("#applytitle").append("应聘岗位： "+sweekerresume.recruitmentInfo.zpname);
	var baseinfo=$("<span></span>").append("基本信息").addClass("label label-info");
	var baseinfo1=$("<dt></dt>").append(baseinfo);
	var baseinfo2=$("<dt></dt>")
	.append("姓名： ").append(sweekerresume.name)
	.append("  ,  ")
	.append("年龄：").append(sweekerresume.age)
	.append("  ,  ");
	var baseinfo3=$("<dt></dt>")
	.append("邮箱：").append(sweekerresume.email)
	.append(" , ")
	.append("电话：").append(sweekerresume.phone);
	//
	var educationinfo=$("<span></span>").append("教育背景").addClass("label label-info");
	var baseinfo4=$("<dt></dt>").append(educationinfo);

	var baseinfo5=$("<dt></dt>")
	.append("院校： ").append(sweekerresume.college)
	.append("  ,  ")
	.append("专业：").append(sweekerresume.major);
	//
	var applyinfo=$("<span></span>").append("求职意向").addClass("label label-info");
	var baseinfo6=$("<dt></dt>").append(applyinfo);

	var baseinfo7=$("<dt></dt>")
	.append("意向行业： ").append(sweekerresume.zhiwei)
	.append("  ,  ")
	.append("意向薪资：").append(sweekerresume.intendedsalary)
	.append("  ,  ")
	.append("工作经历：").append(sweekerresume.workexperience)
	.append("  ,  ")
	.append("专业技能：").append(sweekerresume.skills);
	$("<dl></dl>")
	.append(baseinfo1)
	.append(baseinfo2)
	.append(baseinfo3)
	.append(baseinfo4)
	.append(baseinfo5)
	.append(baseinfo6)
	.append(baseinfo7)
	.appendTo("#sweekerresume");
}
//粘贴简历投递分页导航跳转
function PasteHistoryReceviedResumeNavigatepageNums(result){
	//插入前先清空
	$("#recruitment_info").empty();
	var navigatepages=result.extend.selectResumeWithRecruitmentByZUid.navigatepageNums;
	//当前页
	var pageNum=result.extend.selectResumeWithRecruitmentByZUid.pageNum;
	
	
	var firstPage=$("<li></li>").append($("<a></a>").append("首页"));
	
	firstPage.click(function () {
		HistoryReceviedResumeTopage(1);
	});
	var perviousPage=$("<li></li>").append($("<a></a>").append("&laquo;"));
	
	perviousPage.click(function() {
			if(result.extend.selectResumeWithRecruitmentByZUid.hasPreviousPage==true){
			
				HistoryReceviedResumeTopage(result.extend.selectResumeWithRecruitmentByZUid.prePage);
			}
		});
		
	var nextPage=$("<li></li>").append($("<a></a>").append("&raquo;"));
	
	nextPage.click(function() {
	if(result.extend.selectResumeWithRecruitmentByZUid.hasNextPage==true)
	{
		
		HistoryReceviedResumeTopage(result.extend.selectResumeWithRecruitmentByZUid.nextPage);
	}
	});
	var lastPage=$("<li></li>").append($("<a></a>").append("末页"));
	
	lastPage.click(function () {
		HistoryReceviedResumeTopage(result.extend.selectResumeWithRecruitmentByZUid.pages);
	});
	
	var ul=$("<ul></ul>").addClass("pagination");
	var nav=$("<nav></nav>");
	//判断是否有前一页
	if(result.extend.selectResumeWithRecruitmentByZUid.hasPreviousPage==false)
		{
		firstPage.addClass("disabled");
		perviousPage.addClass("disabled ");
		}
	ul.append(firstPage).append(perviousPage);
	//遍历插入并添加点击事件
	$.each(navigatepages,function(index,items){
		var numli= $("<li></li>").append($("<a></a>").append(items));
		if(pageNum==items){
		
			numli.addClass("active");
		}
		numli.click(function() {
			HistoryReceviedResumeTopage(items);
		});
		ul.append(numli);
		});
	
	//判断是否有后一页
	if(result.extend.selectResumeWithRecruitmentByZUid.hasNextPage==false)
	{
	nextPage.addClass("disabled");
	lastPage.addClass("disabled");
	}
	ul.append(nextPage).append(lastPage);
	nav.append(ul).appendTo("#recruitment_info");
	
}
//粘贴投递分页导航跳转
function HistoryReceviedResumeTopage(page){
	
	$.ajax({
		url:"/user/selectResumeWithRecruitmentByZUid",
		type:"POST",
		data:{uid:uid,pages:page},
		ansyc:false,
		success:function(result){
			if(result.code==100){
				PasteResumeInfoWtihRecruitment(result);
				PasteHistoryReceviedResumeNavigatepageNums(result);
			}
		}
		
	});
}
</script>
</body>
</html>